home *** CD-ROM | disk | FTP | other *** search
- Path: cea.fr!usenet
- From: Xavier Tarrago <tarrago@lcus15.saclay.cea.fr>
- Newsgroups: comp.lang.c++
- Subject: STL & HP C++
- Date: 12 Jan 1996 11:57:01 GMT
- Organization: CEA Commissariat a l'Energie Atomique, France.
- Message-ID: <4d5iad$1a7@news.cea.fr>
- NNTP-Posting-Host: lcus15.saclay.cea.fr
-
- Hello,
- I cannot use STL whith HP C++. When I use STL (vector) I get this
-
- // vector.C
- #include <iostream.h>
- #include "../stl/vector.h"
-
- vector<double> v(10, 0.);
-
- void fonc( vector<double> v)
- {
- for( int i = 0; i< v.size(); i++){
- cout << v[i] << '\n';
- }
- return;
- }
-
- int main(void){
- fonc( v);
- return 0;
- }
-
- I get:
- make vector
- CC -I../stl vector.C -o vector
- CC: "../stl/function.h", line 130: error: template unary_function argument mismatch, th
- e template formal: Arg required a type actual parameter (1782)
- CC: "../stl/function.h", line 146: error: template binary_function argument mismatch, t
- he template formal: Arg1 required a type actual parameter (1782)
- CC: "../stl/function.h", line 146: error: template binary_function argument mismatch, t
- he template formal: Arg2 required a type actual parameter (1782)
- CC: "../stl/function.h", line 164: error: template unary_function argument mismatch, th
- e template formal: Arg required a type actual parameter (1782)
- CC: "../stl/function.h", line 164: error: template unary_function argument mismatch, th
- e template formal: Result required a type actual parameter (1782)
- CC: "../stl/function.h", line 167: sorry, not implemented: use of Operation::first_argu
- ment_type with formal template type parameter (2097)
- CC: sorry, cannot recover from previous errors
- *** Error code 1
-
- Stop.
-
- I can get the same error whith :
- template < class T >
- class tpl {
- T i;
- T::ptr p; // trouble here
- };
-
- class dumm {
- class ptr{
- int i;
- };
- };
-
- int main( void)
- {
- tpl<dumm> t;
- return 0;
- }
-
- make tst
- CC -I../stl tst.C -o tst
- CC: "tst.C", line 4: sorry, not implemented: use of T::ptr with formal template type p
- arameter (2097)
- CC: sorry, cannot recover from previous errors
- *** Error code 1
-
- Stop.
-
- Is ther a way to do that. Maybe a patch or maybe I have to upgrade my
- compiler. I am surprised that STL from HP don't work whith HP C++.
-
- Thank you in advance,
- X.Tarrago
-